public class HomeWork11_07{
    public static void main(String[] args){
        int[] A = new int[]{0, 1, 2, 3, 4};
        int[] B = new int[A.length/2];
        int[] C = new int[A.length/2 + 1];

        DivArr.divArrByOddEven(A, B, C);
        
        for(int item : B){
            System.out.println(item);
        }
        for(int item : C){
            System.out.println(item);
        }
    }
}

class DivArr{
    public static void divArrByOddEven(int[] A, int[] B, int[] C){
        int i = 0;
        int j = 0;
        for(int k = 0; k < A.length; k++){
            if(k % 2 != 0){
                B[i++] = A[k];
            }else{
                C[j++] = A[k];
            }
        }
    }
}